<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class CAdminController extends Controller
{
	protected  function beforeAction( $action ){
				$user = Yii::app()->session["user"];
		$isAdmin = $user["isAdmin"];
		if(!isset($user)||$user["isAdmin"]==false){
			 			 if ($_SERVER["HTTP_HOST"] == "127.0.0.1" && !strpos($_SERVER["REQUEST_URI"], 'site/login')) {
			     $_SESSION["redirect"] = $_SERVER["REQUEST_URI"];
			 }
			 $this->redirect(Yii::app()->createUrl("site/login"));
		}
		return true;
	}
}